import { http } from "@/utils/http";
import { baseUrlApi } from "./utils";
export type BannerResult = {
  page: number;
  pagesize: number;
  success: boolean;
  code: number;
  token: string;
  msg: string;
  data: {
    img(img: any): string;
    data: any[];
    total: number;
    page: number;
    pagesize: number;
  };
};
// 类型列表
export const typeList= (data?: object) => {
  return http.request<BannerResult>("get", baseUrlApi(`admin/type/list?page=${data.page}&pagesize=${data.pagesize}&name=${data.name}`), {
    data
  });
};
// 类型添加
export const typeInsert= (data?: object) => {
  return http.request<BannerResult>("post", baseUrlApi(`admin/type/insert`), {
    data
  });
};
// 类型修改
export const typeUpdate= (data?: object) => {
  return http.request<BannerResult>("post", baseUrlApi(`admin/type/update`), {
    data
  });
};
// 类型删除
export const typeDelete= (data?: object) => {
  return http.request<BannerResult>("post", baseUrlApi(`admin/type/delete`), {
    data
  });
};
// 下拉框展示列表
export const typeSelect= (data?: object) => {
  return http.request<BannerResult>("get", baseUrlApi(`admin/type/select?name=${data.name}`), {
    data
  });
};
